﻿using System;
using AmazeUI.db;
using AmazeUI.Imodel;
using AmazeUI.Imodel.Res;

namespace AmazeUI.bll.GetModel
{
    public class AddPayOrder:IPayOrder
    {
        /// <summary>
        /// 订单实力(有效期默认15天)
        /// </summary>
        /// <param name="model">订单实力</param>
        /// <param name="ip">ip</param>
        /// <param name="adder">地址</param> 
        public AddPayOrder(Goods model,string ip,IAdder adder  )
        {
            this.OrderNo = WebCommon.StringCommand.OnlyId.OnlyTime16();

            this.Body = model.Body;
            this.BodyContent = model.BodyContent;
            this.GoodsId = model.Id;
            this.TotalFee = model.Price;
            this.Remarks = model.Remarks; 

            this.Addre = adder.Adder;
            this.Name = adder.Name;
            this.Phone = adder.Phone;
            this.XtUserId = adder.Xtuserid;

            this.Ip = ip;
            this.OverdueTime = DateTime.Now.AddDays(15);
        }
 
        /// <summary>
        /// 订单实力，
        /// </summary>
        /// <param name="model">订单实力</param>
        /// <param name="adder">地址</param>
        /// <param name="overdueTime">有效时间</param>
        public AddPayOrder(Goods model, string ip, IAdder adder, DateTime overdueTime)
            : this(model, ip, adder)
        {
            this.OverdueTime = overdueTime;
        }
        
        public string Nourl { get; set; }
        public string Returl { get; set; }
        public string Addre { get; set; }
        public string Body { get; set; }
        public string BodyContent { get; set; }
        public int GoodsId { get; set; }
        public string Name { get; set; }
        public string Ip { get; set; }
        public DateTime OverdueTime { get; set; }
        public string Phone { get; set; }
        public int TotalFee { get; set; }
        public string Remarks { get; set; }
        public int XtUserId { get; set; }
        public string OrderNo { get; set; }
    }
}